package io.renren.modules.user.controller;

import java.util.Arrays;
import java.util.Map;

import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import io.renren.modules.user.entity.PgibmperEntity;
import io.renren.modules.user.service.PgibmperService;
import io.renren.common.utils.PageUtils;
import io.renren.common.utils.R;



/**
 * IBM人员
 *
 * @author yangyf
 * @email 
 * @date 2022-11-18 09:29:53
 */
@RestController
@RequestMapping("user/pgibmper")
public class PgibmperController {
    @Autowired
    private PgibmperService pgibmperService;

    /**
     * 列表
     */
    @RequestMapping("/list")
    @RequiresPermissions("user:pgibmper:list")
    public R list(@RequestParam Map<String, Object> params){
        PageUtils page = pgibmperService.queryPage(params);

        return R.ok().put("page", page);
    }


    /**
     * 信息
     */
    @RequestMapping("/info/{userId}")
    @RequiresPermissions("user:pgibmper:info")
    public R info(@PathVariable("userId") Long userId){
		PgibmperEntity pgibmper = pgibmperService.getById(userId);

        return R.ok().put("pgibmper", pgibmper);
    }

    /**
     * 保存
     */
    @RequestMapping("/save")
    @RequiresPermissions("user:pgibmper:save")
    public R save(@RequestBody PgibmperEntity pgibmper){
		pgibmperService.save(pgibmper);

        return R.ok();
    }

    /**
     * 修改
     */
    @RequestMapping("/update")
    @RequiresPermissions("user:pgibmper:update")
    public R update(@RequestBody PgibmperEntity pgibmper){
		pgibmperService.updateById(pgibmper);

        return R.ok();
    }

    /**
     * 删除
     */
    @RequestMapping("/delete")
    @RequiresPermissions("user:pgibmper:delete")
    public R delete(@RequestBody Long[] userIds){
		pgibmperService.removeByIds(Arrays.asList(userIds));

        return R.ok();
    }

}
